package com.gitee.huanminabc.dynamicdb.dal.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gitee.huanminabc.dynamicdb.aop.DBSwitch;
import com.gitee.huanminabc.dynamicdb.dal.mapper.DatasourceMapper;
import com.gitee.huanminabc.dynamicdb.entity.DataSourceEneity;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description:
 * @Author huanmin
 * @Date 2024/5/23 上午9:52
 */
@Service
public class DatasourceManager extends ServiceImpl<DatasourceMapper, DataSourceEneity>  implements IService<DataSourceEneity> {

    public List<DataSourceEneity> getDataSources() {
        LambdaQueryWrapper<DataSourceEneity> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(DataSourceEneity::getState, 1);
        return list(queryWrapper);
    }
}
